#ifndef __i2c83xx_h__
#define __i2c83xx_h__
/**HEADER********************************************************************
* 
* Copyright (c) 2008 Freescale Semiconductor;
* All Rights Reserved
*
* Copyright (c) 2004-2008 Embedded Access Inc.;
* All Rights Reserved
*
* Copyright (c) 1989-2008 ARC International;
* All Rights Reserved
*
*************************************************************************** 
*
* THIS SOFTWARE IS PROVIDED BY FREESCALE "AS IS" AND ANY EXPRESSED OR 
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  
* IN NO EVENT SHALL FREESCALE OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 
* THE POSSIBILITY OF SUCH DAMAGE.
*
**************************************************************************
*
* $FileName: i2c_mpc83xx.h$
* $Version : 3.8.1.0$
* $Date    : May-12-2011$
*
* Comments:
*
*    This file contains the definitions of constants and structures
*    required for the I squared C (I2C) drivers for the MPC83xx.
*
*END*********************************************************************/

/*--------------------------------------------------------------------------*/
/*
**                            CONSTANT DEFINITIONS
*/


/* 
** IOCTL calls specific to I2C 
*/
#define IO_IOCTL_I2C_GET_LAST_TX_STATUS               _IO(IO_TYPE_I2C,0x13) /* mpc83xx */
#define IO_IOCTL_I2C_GET_LAST_RX_STATUS               _IO(IO_TYPE_I2C,0x14) /* mpc83xx */

/*--------------------------------------------------------------------------*/
/*
**                    DATATYPE DECLARATIONS
*/

/*
** MPC83xx_I2C_INIT_STRUCT
**
** This structure defines the initialization parameters to be used
** when an I2C port is initialized.
*/
typedef struct mpc83xx_i2c_init_struct
{
   /* The I2C channel to initialize */
   uint_8                 CHANNEL;

   /* Default operating mode */
   uint_8                 MODE;

   /* The I2C station address for the channel */
   uint_8                 STATION_ADDRESS;

   /* Desired baud rate */
   uint_32                BAUD_RATE;

   /* Interrupt level to use if interrupt driven */
   uint_32                LEVEL;

   /* Sub level within the interrupt level to use if interrupt driven */
   uint_32                SUBLEVEL;

   /* Tx buffer size (interrupt only) */
   uint_32                TX_BUFFER_SIZE;

   /* Rx buffer size (interrupt only) */
   uint_32                RX_BUFFER_SIZE;

} MPC83xx_I2C_INIT_STRUCT, _PTR_ MPC83xx_I2C_INIT_STRUCT_PTR;



/*--------------------------------------------------------------------------*/
/* 
**                        FUNCTION PROTOTYPES
*/

#ifdef __cplusplus
extern "C" {
#endif

extern uint_32 _mpc83xx_i2c_polled_install(char_ptr, pointer);
extern uint_32 _mpc83xx_i2c_int_install(char_ptr, pointer);
extern pointer _bsp_get_i2c_base_address (uint_8);
extern uint_32 _bsp_get_i2c_vector (uint_8);

#ifdef __cplusplus
}
#endif

#endif
/* EOF */
